<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>

<%@ include file="../init_include.jsp" %>

<html>
<head>
<title><%=Language.getNameByCode("sys.sysop.search","Search User")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
<link rel="stylesheet" href="../css.css" type="text/css">
<script Language="JavaScript" src="../script/Ion_Show.js"></script> 
<script language="javascript">
<!--
	function checkForm() {
		whereClause="";
		if(document.formIon.name.value!="")
			whereClause+=" and sysop.name like '%"+document.formIon.name.value+"%'";
		if(document.formIon.fullname.value!="")
			whereClause+=" and fullname like '%"+document.formIon.fullname.value+"%'";
		if(document.formIon.email.value!="")
			whereClause+=" and sysop.email like '%"+document.formIon.email.value+"%'";
		if(document.formIon.departid.value!="0")
			whereClause+=" and departid="+document.formIon.departid.value;
		if(document.formIon.status.value!="-1")
			whereClause+=" and status="+document.formIon.status.value;
		whereClause+=" ";
		whereClause=whereClause.substring(4);
		setWhereClause(whereClause);
		closewindow(0);			
		close();
	}
-->
</script>
</head>
<%
	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid","000000010"); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS) {
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}
	
	Sysop sysop=(Sysop)session.getAttribute("sysop");
				
	int catid=0;
	try {	
		if(request.getParameter("catid")!=null)
			catid=Integer.parseInt(request.getParameter("catid"));		
	} 
	catch (NumberFormatException e) {
		out.println(e);
		return ;
	}
	String name="",fullname="",password="",email="",departName="";	
	int departid=0,status=-1,rightflag=0,parentid=0,layer=0,groupid=0;
		
%>

<body class="bgcolor_title_tr">
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="input_title">
  <tr>
    <td><%=Language.getNameByCode("sys.sysop.search","Search User")%></td>
  </tr>
</table>
<hr>
<table border="0" cellspacing="1" cellpadding="2" bgcolor="#666666" width="90%">
	<form method="post" name="formIon" action="sysop_search.jsp" onSubmit="return checkForm();">
  <tr class="bgcolor_title_tr"> 
    <td class="input_title" align="right"><%=Language.getNameByCode("sys.sysop.name","Username")%>:</td>
    <td><input type="text" name="name" maxlength="60" size="30" value="<%=name%>"></td>
  </tr>
  <tr class="bgcolor_title_tr"> 
    <td class="input_title" align="right"><%=Language.getNameByCode("sys.sysop.fullname","Fullname")%>: </td>
    <td> 
      <input type="text" name="fullname" maxlength="60" size="30" value="<%=fullname%>">
    </td>
  </tr>
  <tr class="bgcolor_title_tr"> 
    <td class="input_title" align="right"><%=Language.getNameByCode("sys.sysop.email","Email")%>:</td>
    <td> 
      <input type="text" name="email" maxlength="46" size="30" value="<%=email%>">
    </td>
  </tr>
  <tr class="bgcolor_title_tr"> 
    <td class="input_title" align="right"><%=Language.getNameByCode("sys.sysop.depart","Department")%>:</td>
    <td> 
      <input type="text" name="departname" maxlength="46" size="30" value="<%=departName%>" readonly>
      <input type="hidden" name="departid" value="<%=departid%>"><input type="button" name="Button" value="<%=Language.getNameByCode("sys.select","Select")%>" onClick='getIonDepart(<%=departid%>)'>    
    <!--
    	<select name=departid size=1>
    		<option value="-1"><%=Language.getNameByCode("sys.all","all")%></option>
      	<%//=Department.getAllChildrenWithOwnOption(dbi,departid)%>
      </select>
     -->
    </td>
  </tr>
  <tr class="bgcolor_title_tr"> 
    <td class="input_title" align="right"><%=Language.getNameByCode("sys.sysop.status","Status")%>:</td>
    <td> 
    	<select name="status" onChange="getStatus();">
    		<option value="-1"><%=Language.getNameByCode("sys.all","all")%></option>
    	<% String  statusstr[]=StaticDim.getUserStatus();
    		 for(int i=0;i<statusstr.length;i++) {
    		 	if(status==i)
    		 		out.print("<option value=\""+i+"\" selected>"+statusstr[i]+"</option>");
    		 	else
    		 		out.print("<option value=\""+i+"\">"+statusstr[i]+"</option>");
    		 }
    	%>
    	</select>
    </td>
  </tr>
</table>
<input type="submit" name="Submit" value="<%=Language.getNameByCode("sys.Submit","Submit")%>">	
<input type="reset" name="Submit" value="<%=Language.getNameByCode("sys.Reset","Reset")%>">	
<input type="button" name="close" value="<%=Language.getNameByCode("sys.Close","Close")%>" onClick="closewindow();">	
<input type="hidden" name="catid" value="<%=catid%>">
<input type="hidden" name="parentid" value="<%=parentid%>">
<input type="hidden" name="layer" value="<%=layer%>">
</form>
</body>
</html>
<%@ include file="../init_free.jsp" %>